<template>
	<div>
	<a href="/#/Myall"><el-button type="primary">主要按钮</el-button></a>
<el-form :model="dataForm" status-icon ref="dataForm" label-width="100px" class="">
  <el-form-item label="姓名" prop="name">
    <el-input type="text" v-model="dataForm.b_name" ></el-input>
  </el-form-item>
  <el-form-item label="密码" prop="checkPass">
    <el-input type="password" v-model="dataForm.b_pwd"></el-input>
  </el-form-item>
  <el-form-item>
    <el-button type="primary" @click="submitForm()">提交</el-button>
    <el-button @click="resetForm('ruleForm2')">重置</el-button>
  </el-form-item>
</el-form>
</div>
</template>
<script>
export default {
	data() {
		return {
			dataForm: {
				b_name: '',
				b_pwd: ''
			}
		};
	},
	methods: {
		submitForm() {
			var _this=this;
			_this.$ajax.post('http://1319.cc/ha',_this.dataForm)
			  .then(function (response) {
			    alert(response.data.msg);
				if(response.data.code==0){
					_this.$router.push({name:'Myall'});
			  }
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		resetForm(formName) {
			this.$refs[formName].resetFields();
		}
	}
};
</script>
